package com.victor.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.victor.dao.My_bankcardDao;
import com.victor.entity.user.User;
import com.victor.entity.user.UserBankcard;
import com.victor.service.My_bankcardService;


@Service
public class My_bankcardServiceImpl implements My_bankcardService {

	@Autowired
	private My_bankcardDao dao;

	/**
	 * 通过用户id查询银行卡列表
	 */
	@Override
	public List<UserBankcard> selBankcardListByUserid(String userid) {
		return dao.selBankcardListByUserid(userid);
	}

	/**
	 * 通过银行卡id查询银行卡详情
	 */
	@Override
	public UserBankcard bankCardDetail(Integer id) {
		return dao.bankCardDetail(id);
	}

	/**
	 * 通过用户id查询支付密码
	 */
	@Override
	public String ifpaypassword(Integer id) {
		return dao.ifpaypassword(id);
	}

	/**
	 * 通过用户id查询用户信息
	 */
	@Override
	public User selectUserById(String userid) {
		Integer id = Integer.parseInt(userid);
		return dao.selectUserById(id);
	}

	/**
	 * 绑定银行卡
	 */
	@Override
	public boolean bindBrandCard(UserBankcard userBankcard) {
		return dao.bindBrandCard(userBankcard);
	}

	/**
	 * 通过银行卡id解绑银行卡
	 */
	@Override
	public boolean unbindBrandCard(Integer id) {
		return dao.unbindBrandCard(id);
	}

}
